#include "../User/Task/Power.h"

#include "../User/Device/Power.h"
#include "cmsis_os.h"
#include "main.h"
#include "sys.h"

/* USER CODE BEGIN Header_Task_Power */
/**
 * @brief Function implementing the TaskPower thread.
 * @param argument: Not used
 * @retval None
 */
/* USER CODE END Header_Task_Power */
void Task_Power(void *argument) {
  const uint32_t delay_tick = osKernelGetTickFreq() / TASK_POWER_SCAN_FREQ;

  uint32_t tick = osKernelGetTickCount();

  while (1) {
    tick += delay_tick;

    Power_Work();

    osDelayUntil(tick);
  }
}
